package Functii;

import Operatori.Cat;
import Operatori.Minus;
import Operatori.Plus;
import Operatori.Produs;

public class SinHiperbolic extends Functie{
	
	public double calcul(double aux1){
		return Math.sinh(aux1);
	}
	
	public static double Calcul(double aux1){
		return Math.sinh(aux1);
	}
		
	public String derivare(){
		if(getFStang()==null)
			System.exit(1);
		return Cat.concatTermens( Minus.concatTermens ("e^"+getFStang().toString(),"e^"+getFStang().toString()), "2");
		
		
		
		
	}
	
	public double calculDerivata(){
		if(getFStang()==null)
			System.exit(1);
		return Cat.Calcul(getFStang().calculDerivata(), Minus.Calcul(getFStang().calculDerivata(),Math.pow(Math.E, getFStang().calcul())));
				
			
	}
	
	public String concatTermeni(String aux1)
	{
		String aux;
		int nrP;
		nrP=aux1.charAt(0)=='(' ? 0:2;
		aux="sh";
		if(nrP!=0)
			aux+="(";
		aux+=aux1;
		if (nrP!=0)
			aux+=")";
		return aux;
	}
	
	public static String concatTermens(String aux1)
	{
		String aux;
		int nrP;
		nrP=aux1.charAt(0)=='(' ? 0:2;
		aux="sh";
		if(nrP!=0)
			aux+="(";
		aux+=aux1;
		if (nrP!=0)
			aux+=")";
		return aux;
	}

}
